<?php

namespace App\Http\Controllers;

use App\Facades\SmsCode;
use App\Http\Requests\SendSmsCodeRequest;
use App\Models\User;

class GlobalController extends Controller
{

    /**
     * 显示首页
     *
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function showIndex()
    {
        dd(SmsCode::send(17633190977));
        return $this->view('index');
    }

    /**
     * 发送短信验证码
     *
     * @param SendSmsCodeRequest $request
     * @param string $mobile
     *
     * @return string
     */
    public function sendSmsCode(SendSmsCodeRequest $request, $mobile)
    {
        if (SmsCode::send($mobile)) {

            return '发送成功';
        }

        return '发送失败';
    }
}